package com.imooc.pan.web.core.utils;


/**
 * 类功能描述:密码工具类
 *
 * @Author: 张广焱
 * @Date: 2024-10-06  18:02:41
 * @Version: 1.0.0
 */
public class PasswordUtil {

    /**
     * 随机生成盐值
     *
     * @return
     */
    public static String getSalt() {
        return MessageDigestUtil.md5(UUIDUtil.getUUID());
    }

    /**
     * 密码加密
     *
     * @param salt
     * @param inputPassword
     * @return
     */
    public static String encryptPassword(String salt, String inputPassword) {
        return MessageDigestUtil.sha256(MessageDigestUtil.sha1(inputPassword) + salt);
    }

}
